Quickbook API
Creating a booking
POST /booking/create
Description
This endpoint allows booking a journey with Addison Lee. It supports the following scenarios:
- Request a booking without previous quote
- Request a booking with quote reference
Authorization
The Authorization
header carried the API access token in the format AL client_id:client_secret
. Please see Security page for more information.
Content Type
application/json
Creating a booking without quotation
Passenger booking
{
"pickup_dt": "2017-10-01T09:00:00+01:00",
"payment_method": "Account",
"service": "standard_car",
"locations": [
{
"source": "Address",
"street_address": "Barbican Centre, 10 Silk St",
"town": "London",
"postcode": "EC2Y 8DS",
"country": "GB",
"lat": 51.520024,
"long": -0.092447,
"notes": "Wait before the car park and taxis entrance"
},
{
"source": "Airport",
"street_address": "London Heathrow Airport",
"lat": 51.47138888,
"long": -0.45277777,
"airport": {
"iata": "LHR",
"terminal": "2",
"flight_number": "BA714",
"arrival_from": "LAX"
}
}
],
"contact": {
"name": "John Doe",
"mobile": "07123456789",
"email": "john.doe@example.com"
},
"passengers": [
{
"name": "Jane Doe",
"mobile": "07262555555",
"email": "jane.doe@example.com"
},
{
"name": "Jane Smith",
"mobile": "07123456789",
"email": "jane.smith@example.com"
}
]
}
Courier booking
{
"pickup_dt": "2017-10-01T09:00:00+01:00",
"payment_method": "Account",
"service": "small_van",
"locations": [
{
"source": "Address",
"street_address": "Barbican Centre, 10 Silk St",
"town": "London",
"postcode": "EC2Y 8DS",
"country": "GB",
"lat": 51.520024,
"long": -0.092447,
"contact": {
"name": "John Doe",
"mobile": "07123456789",
"email": "john.doe@example.com"
}
},
{
"source": "Address",
"street_address": "The Point, 37 N Wharf Rd",
"town": "London",
"postcode": "W2 1AF",
"country": "GB",
"lat": 51.518461,
"long": -0.178570,
"contact": {
"name": "Jane Doe",
"mobile": "07123436789",
"email": "jane.doe@example.com"
}
}
]
"contact": {
"name": "Sam Doe",
"mobile": "0333 1234 56789",
"email": "sam.doe@example.com"
}
}
Parameters | Description | Required? |
---|---|---|
request_id | Request ID obtained from previous quote/price request | Required for booking with quote |
quote_id | Quote Id obtained from previous quote/price request | Required for booking with quote |
pickup_dt | The date of the pickup. If omitted, then the journey is treated as ASAP | No |
payment_method | The payment method to be used for the journey. Valid values: Account , MultiAccount See Dev Guides / Multi-account | Yes |
locations | Array of locations. See Dev Guides / Building the locations array | |
as_directed_hours | The period (in hours) in which the car is hired. This value is only considered when only one location is present. | No |
service | The product name for this journey. See Dev Guides / Passenger and courier service types | Yes |
contact | Booking main contact | Yes |
contact.name | Contact name | Yes |
contact.mobile | Mobile phone number | Yes |
contact.email | Email address | Yes |
passengers | Array of passengers | Yes [3] |
passengers.name | Passenger name for the journey | Yes |
passengers.mobile | Mobile phone number of the passenger for the journey | Yes |
passengers.email | Email address of the passenger for the journey | Yes |
as_directed | The ride locations are pointed by the customer in the course of the trip. The possible values are true or false . If "as_directed" : true the request message can have only one location | No[2] |
as_directed_hours | The period (in hours) in which the car is hired. Numeric | Required if "as_directed" : true [2] |
destination_unknown | The customer does not specify the final location for the trip. This value is independent from as_directed , and as_directed_hours . Possible values are true or false . If "destination_unknown" : true the request message can have only one location | No[2] |
[1] required only if the parent object is present
[2] can't be used in bookings with a quote, only direct bookings
[3] not required for courier bookings
Creating a booking with quotation
Passenger booking
{
"request_id": "682d84f0-ee14-424c-8252-eee72aa5f290",
"quote_id": "000e4a24-1735-417b-81ab-89e57d6d154b",
"pickup_dt": "2017-10-01T09:00:00+01:00",
"payment_method": "Account",
"service": "standard_car",
"contact": {
"name": "John Doe",
"mobile": "07123456789",
"email": "john.doe@example.com"
},
"passengers": [
{
"name": "Jane Doe",
"mobile": "07262555555",
"email": "jane.doe@example.com"
},
{
"name": "Jane Smith",
"mobile": "07123456789",
"email": "jane.smith@example.com"
}
]
}
Courier booking
{
"request_id": "682d84f0-ee14-424c-8252-eee72aa5f290",
"quote_id": "000e4a24-1735-417b-81ab-89e57d6d154b",
"pickup_dt": "2017-10-01T09:00:00+01:00",
"payment_method": "Account",
"service": "small_van",
"contact": {
"name": "Sam Doe",
"mobile": "0333 1234 56789",
"email": "sam.doe@example.com"
}
}
Parameters | Description | Required? |
---|---|---|
request_id | Request ID obtained from previous quote/price request | Required for booking with quote |
quote_id | Quote Id obtained from previous quote/price request | Required for booking with quote |
pickup_dt | The date of the pickup. If omitted, then the journey is treated as ASAP | No |
payment_method | The payment method to be used for the journey. Valid values: Account , MultiAccount See Dev Guides / Multi-account | Yes |
as_directed_hours | The period (in hours) in which the car is hired. This value is only considered when only one location is present. | No |
service | The product name for this journey. See Dev Guides / Passenger and courier service types | Yes |
contact | Booking main contact | Yes |
contact.name | Contact name | Yes |
contact.mobile | Mobile phone number | Yes |
contact.email | Email address | Yes |
passengers | Array of passengers information | Yes [3] |
passengers.name | Passenger name for the journey | Yes |
passengers.mobile | Mobile phone number of the passenger for the journey | Yes |
passengers.email | Email address of the passenger for the journey | Yes |
as_directed | The ride locations are pointed by the customer in the course of the trip. The possible values are true or false . If "as_directed" : true the request message can have only one location | No[2] |
as_directed_hours | The period (in hours) in which the car is hired. Numeric | Required if "as_directed" : true [2] |
destination_unknown | The customer does not specify the final location for the trip. This value is independent from as_directed , and as_directed_hours . Possible values are true or false . If "destination_unknown" : true the request message can have only one location | No[2] |
[1] required only if the parent object is present
[2] can't be used in bookings with a quote, only direct bookings
[3] not required for courier bookings
Extra Information
"information": [
{
"type": "Notes",
"value": "Special Instruction Notes"
},
{
"type": "Description",
"value": "Addison Lee to Collect John Doe"
}
]
Parameters | Description | Required? |
---|---|---|
information.type | The type of information to be sent | yes |
information.value | The value of the information to be sent | yes |
Extra information types:
Notes
: Free text notes to show to the driver.Description
: Specific description information to show to the driver.
Important: Only one instance of each type is allowed. You can't post two Notes
, for example.
Partner Reference
Some partners can implement an automatic retry for unsuccessful requests.
To prevent the creation of duplicated bookings, partners MUST include the partner reference booking ID in every booking request. Not supplying the partner reference booking ID will create a new booking for every request made.
This is a unique identifier of the booking in the partner' system.
Quickbook API uses the partner reference booking ID to guarantee that only one booking is created for a partner reference ID, even if the same request is received multiple times.
Additionally, the partner can also send the partner reference booking number. This is a more user-friendly identifier of the booking in the partner' system.
Below is an example of the partner reference object to include in the booking request.
"partner_reference": {
"booking": {
"id": "9d8760a1-84cb-42d5-8887-f9574e75ede7",
"number": "345677"
}
Parameters | Description | Type | Required? |
---|---|---|---|
partner_reference.booking.id | This is a unique identifier of the booking in the partner' system. | String - 64 chars | Yes |
partner_reference.booking.number | This is a more user-friendly identifier of the booking in the partner' system. | String - 64 chars | No |
Additional details for the data types and format are provided in the API Console Documentation.
References
References are used for account-specific booking info, for example, 'department number' or 'cost code'.
References are only parsed if the used Account set-up supports or requires it; otherwise, they will be discarded.
"references" : [
{
"name" : "Cost Code",
"value" : "EX-389"
},
{
"name" : "Department",
"value" : "Accounts"
}
]
Parameters | Description | Required? |
---|---|---|
references.name | Name of the reference | Yes[1] |
reference.value | Value of the reference | Yes[1] |
[1] required only if the parent object is present
Response
{
"job_uuid" : "36b5ffa8-61f0-11e5-9d70-feff819cdc9f",
"job_number" : "654321",
"booking_status" : "booked"
}
Parameters | Description |
---|---|
job_uuid | Unique system identified for the booking |
job_number | User reference for the booking. Needs to be used in conjunction with the booking date |
booking_status | The booking status for your journey. This should be booked |